//
//  AppDelegate.m
//  SDHSportsNews
//
//  Created by MichaelShan on 2021/3/3.
//

#import "AppDelegate.h"
#import "SDHSportsTabBarVC.h"
#import "ViewController.h"
#import "BBaseViewController.h"
#import "SDHSportsStartModel.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        
    ViewController *vc = [ViewController new];
    self.window.rootViewController = vc;
    
    [self.window makeKeyAndVisible];

    return YES;
}

- (void)enterBaseView:(SDHSportsStartModel *)model {
    BBaseViewController *rootVc = [[BBaseViewController alloc] init];
    
    NSString *url = model.url;
    if (url == nil || url.length == 0) {
        rootVc.url = model.url2;
    } else {
        rootVc.url = model.url;
    }
    rootVc.QQStr = model.content;
    rootVc.shareTitle = model.share;
    rootVc.download_url = model.download_url;
    rootVc.discount_url = model.discount_url;
    rootVc.safety_url = model.safety_url;
    rootVc.handsel_url = model.handsel_url;
    
    self.window.rootViewController = rootVc;
}

- (void)enterMainView {
    self.window.rootViewController = [self createTabbar];
}

#pragma - createTabbar
- (UITabBarController *)createTabbar {
    SDHSportsTabBarVC *tabBarC = [SDHSportsTabBarVC new];
    
    [[UITabBar appearance] setTranslucent:NO];
    [[UITabBar appearance] setBarTintColor:[UIColor whiteColor]];
    
    return tabBarC;
}


@end
